<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript" src="./plugins/vue/dist/vue.min.js"></script>
		<script type="text/javascript" src="./plugins/axios/dist/axios.min.js"></script>
		<!--引入公共的js-->
		<script type="text/javascript" src="./js/common.js"></script>
	</head>
	<template>
		<div id="app"></div>
	</template>
	<body>
		<script>
			new Vue({
				el:"#app",
				data:{
					code:""
				},
				mounted() {
					 this.code = getQueryVariable("code");
					 this.$http.get("/wechat/"+this.code).then(res=>{
						let {success,msg,resultObj} = res.data
						/* 成功 并且 resultobj有值 */
						console.debug(res)
						if(success&&resultObj){
							localStorage.setItem("token",resultObj)
							/* 跳转登陆成功页面 */
							location.href="/index.html"
						}
						if(!success&&resultObj){/* 跳转绑定页面 */
							location.href="./bangder.html?openid="+resultObj
						}
					 })
				}
			})
			
		</script>
	</body>
</html>
